package cn.apestar.common.chat;

import java.io.IOException;
import java.util.List;

import org.apache.http.client.ClientProtocolException;

import cn.apestar.common.chat.model.RegUser;

/**
 * 聊天
 * @author lvh
 */
public interface Chat {

    /**
     * 获取TOKEN
     * @return
     */
    public String getToken();

    /**
     * 注册IM用户[单个]
     * @throws IOException
     * @throws ClientProtocolException
     * @param username 当前用户
     * @param newpassword 新密码
     */
    public boolean regUser(String username, String password, String nickname);

    /**
     * @return boolean
     */
    public boolean chatmessages();

    /**
     * 删除IM用户[单个]
     * @throws IOException
     * @throws ClientProtocolException
     * @param username 删除的用户
     */
    public boolean delUser(String username);

    /**
     * 重置IM用户密码
     * @throws IOException
     * @throws ClientProtocolException * @param username 当前用户
     * @param newpassword 新密码
     */
    public boolean resetUserPassword(String username, String newpassword);

    /**
     * 给IM用户添加好友
     * @param username 当前用户
     * @param newUser 好友用户
     */
    public boolean addFriend(String username, String newUser);

    /**
     * 删除用户添加好友
     * @throws IOException
     * @throws ClientProtocolException
     * @param username 当前用户
     * @param newUser 好友用户
     */
    public boolean delFriend(String username, String newUser);

    /**
     * 发送消息到APP
     * @param phone
     * @return
     * @throws IOException
     * @throws ClientProtocolException
     */
    public boolean transmissionMessageByone(String username, String message, String type,
        String messageType);

    public void transmissionMessageFromOneToOne(String fromone, String username, String message,
        String type, String messageType, Object... values);

    public void transmissionMessageFromOneToOne(String fromone, String username, String message,
        String type, String messageType, List list);

    /**
     * 注册IM用户[多个]
     * @param username 当前用户
     * @param nickname 别名
     * @throws IOException
     */
    public void regPlUser(List<RegUser> user);

}
